package com.csii.activiti.server.component.ribbon.callback.config;

import com.csii.activiti.server.abstraction.service.optional.ActCallbackService;
import com.csii.activiti.server.component.ribbon.callback.ActCloudCallbackServiceImpl;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class ActRibbonCallbackConfig {

    @Bean
    @LoadBalanced
    public RestTemplate callbackCloudRestTemplate(){
        RestTemplate restTemplate = new RestTemplate();
        return restTemplate;
    }

    @Bean
    public ActCallbackService actCloudCallbackServiceImpl(){
        return new ActCloudCallbackServiceImpl();
    }

    @Bean
    public BeanDefinitionRegistryPostProcessor beanDefinitionRegistryPostProcessor(){
        return new ConditionBeanPostProcessor();
    }

}
